package com.wyd.qxglmybatis.service;

import java.util.List;

import javax.annotation.Resource;

import com.wyd.qxglmybatis.dao.IUsersDao;
import com.wyd.qxglmybatis.dto.UsersDTO;
import com.wyd.qxglmybatis.model.Users;

import org.springframework.stereotype.Service;

@Service
public class UsersServiceImpl implements IUsersService {

    @Resource
    private IUsersDao usersDao;

    @Override
    public List<Users> findAll(UsersDTO dto) {
       
        return usersDao.findAll(dto);
    }

    @Override
    public int getCount(UsersDTO dto) {
       
        
        return usersDao.getCount(dto);
    }

    @Override
    public int addOrEditUser(Users u) {

        if(u.getId()!=null){
            return  usersDao.editUser(u);


        }else{
            return usersDao.addUser(u);
        }
       
        
    }

    @Override
    public int del(String id) {
      

        return usersDao.del(id);
    }

    @Override
    public void deleteCTQ(String[] id) {
      
        usersDao.deleteCTQ(id);

    }

    @Override
    public int resetPWD(String id) {
       

        return usersDao.resetPWD(id);
    }

    @Override
    public int lockUser(String id) {
        
        return usersDao.lockUser(id);
    }

    @Override
    public int unLockUser(String id) {
       
        return usersDao.unLockUser(id);
    }

  

   /*  @Override
    public int editUser(String id,String  login_name,String  protectemail,String  protectmtel) {
      
        return usersDao.editUser(id,login_name,protectemail,protectmtel);
    } */

  

}